#include "pch.h"
#include "dxrTypes.h"

MeshData::MeshData()
	:is_updated(true)
{
	vertex_buffer = std::make_shared<BufferDataBrige>();
	index_buffer = std::make_shared<BufferDataBrige>();
}

MeshData::~MeshData()
{
	vertex_buffer.reset();
	index_buffer.reset();
	blas_scratch = nullptr;
	blas = nullptr;
}

InstanceData::InstanceData()
	:is_updated(false)
	, mesh(nullptr)
{

}

InstanceData::~InstanceData()
{

}

/**
RenderTargetData::RenderTargetData()
{

}

RenderTargetData::~RenderTargetData()
{

}*/

TextureDataBrige::TextureDataBrige()
{

}

TextureDataBrige::~TextureDataBrige()
{
	d3d12_tex = nullptr;
	d3d11_tex = nullptr;
	host_ptr = nullptr;
	if (handle && is_nt_handle)
		::CloseHandle(handle);

}

BufferDataBrige::BufferDataBrige()
{

}

BufferDataBrige::~BufferDataBrige()
{
	d3d11_buffer = nullptr;
	d3d12_buffer = nullptr;
	host_ptr = nullptr;
	if (handle && is_nt_handle)
		::CloseHandle(handle);
}
